package com.smooth.site.sx.mag.biz.pic.service;

import java.io.IOException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.smooth.site.sx.mag.biz.pic.enums.PicTypeEnums;

import net.coobird.thumbnailator.Thumbnails;

@Component
public class PicResizeService {
	@Autowired
	BizPicService bizPicService;
	
	public String resizeImg(PicTypeEnums picTypeEnums,String fileName,String targetFile,Double sizeH) throws IOException {
		Thumbnails.of(fileName)
        .scale(sizeH)
        .outputQuality(sizeH)
        .toFile(targetFile);
		
		return targetFile;
//		PicUtils  picUtils = new PicUtils(fileName,"");
//		picUtils.zoomByScale(sizeH);
//		fileName = picUtils.destFile;
	}
}
